<?php 
namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use DB;
class Templates extends Model
{
     protected $connection="mysql2";//指定数据库
}